<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

	<title>订单信息</title>

	<script language="javascript" type="text/javascript" src="${ctx}/static/js/jquery.coolfieldset.js"></script>
	<link rel="stylesheet" type="text/css" href="${ctx}/static/css/jquery.coolfieldset.css" />
	<script type="text/javascript">
		var menu_flag = 'order';

		$(document).ready(function(){
			$('#base_info').coolfieldset();
			//$('#fieldset2').coolfieldset({collapsed:true});
			//$('#fieldset4').coolfieldset({speed:"fast"});
			//$('#fieldset5').coolfieldset({animation:false});
		});
	</script>
	<script src="${ctx}/static/js_obj/company.type.js"></script>
</head>
<body>
	
	<div class="sitemap" id="sitemap">

		当前位置: <a href="list">订单管理</a> -&gt; 新建订单
	</div>
	
	<div class="mainoutside mt18">
		<div id="secmainoutside">
			<div class="title">添加订单</div>

			<fieldset id="base_info" class="coolfieldset">
				<legend>基本信息</legend>
				<div style="padding:2px">
					<table>
						<tr>
							<td>整装类型：</td>
							<td>
								<select name="containerType" onchange="alert(1);">
									<option value="1">FCL</option>
									<option value="2">LCL</option>
								</select><br/>
							</td>
							<td>订单月份：</td>
							<td>
								<input type="text" value="2011-12-11"/>
							</td>
						</tr>
						<tr>
							<td>客户名称：</td>
							<td>
								<select name="customer.id">
									<option value="1">深圳鑫远航</option>
									<option value="2">武汉锋火</option>
								</select><br/>
							</td>
							<td>客户资料：</td>
							<td>
								<textarea rows="5" cols="50"></textarea>
							</td>
							<td></td>
							<td></td>
						</tr>
					</table>
				</div>
			</fieldset>
			
			<fieldset id="base_info" class="coolfieldset">
				<legend>基本信息</legend>
				<div style="padding:2px">
					<table>
						<tr>
							<td>整装类型：</td>
							<td>
								<select name="containerType">
									<option value="1">FCL</option>
									<option value="2">LCL</option>
								</select>
							</td>
							<td>订单月份：</td>
							<td>
								<input type="text" value="2011-12-11"/>
							</td>
						</tr>
						<tr>
							<td>客户名称：</td>
							<td>
								<select name="customer.id">
									<option value="1">深圳鑫远航</option>
									<option value="2">武汉锋火</option>
								</select>
							</td>
							<td>客户资料：</td>
							<td>
								<textarea rows="5" cols="50"></textarea>
							</td>
							<td></td>
							<td></td>
						</tr>
					</table>
				</div>
			</fieldset>
			
			<fieldset id="base_info" class="coolfieldset">
				<legend>基本信息</legend>
				<div style="padding:2px">
					<table>
						<tr>
							<td>整装类型：</td>
							<td>
								<select name="containerType">
									<option value="1">FCL</option>
									<option value="2">LCL</option>
								</select>
							</td>
							<td>订单月份：</td>
							<td>
								<input type="text" value="2011-12-11"/>
							</td>
						</tr>
						<tr>
							<td>客户名称：</td>
							<td>
								<select name="customer.id">
									<option value="1">深圳鑫远航</option>
									<option value="2">武汉锋火</option>
								</select>
							</td>
							<td>客户资料：</td>
							<td>
								<textarea rows="5" cols="50"></textarea>
							</td>
							<td></td>
							<td></td>
						</tr>
					</table>
				</div>
			</fieldset>
			
			<fieldset id="base_info" class="coolfieldset">
				<legend>基本信息</legend>
				<div style="padding:2px">
					<table>
						<tr>
							<td>整装类型：</td>
							<td>
								<select name="containerType">
									<option value="1">FCL</option>
									<option value="2">LCL</option>
								</select>
							</td>
							<td>订单月份：</td>
							<td>
								<input type="text" value="2011-12-11"/>
							</td>
						</tr>
						<tr>
							<td>客户名称：</td>
							<td>
								<select name="customer.id">
									<option value="1">深圳鑫远航</option>
									<option value="2">武汉锋火</option>
								</select>
							</td>
							<td>客户资料：</td>
							<td>
								<textarea rows="5" cols="50"></textarea>
							</td>
							<td></td>
							<td></td>
						</tr>
					</table>
				</div>
			</fieldset>
			
			<fieldset id="base_info" class="coolfieldset">
				<legend>基本信息</legend>
				<div style="padding:2px">
					<table>
						<tr>
							<td>整装类型：</td>
							<td>
								<select name="containerType">
									<option value="1">FCL</option>
									<option value="2">LCL</option>
								</select>
							</td>
							<td>订单月份：</td>
							<td>
								<input type="text" value="2011-12-11"/>
							</td>
						</tr>
						<tr>
							<td>客户名称：</td>
							<td>
								<select name="customer.id">
									<option value="1">深圳鑫远航</option>
									<option value="2">武汉锋火</option>
								</select>
							</td>
							<td>客户资料：</td>
							<td>
								<textarea rows="5" cols="50"></textarea>
							</td>
							<td></td>
							<td></td>
						</tr>
					</table>
				</div>
			</fieldset>
			
			<fieldset id="base_info" class="coolfieldset">
				<legend>基本信息</legend>
				<div style="padding:2px">
					<table>
						<tr>
							<td>整装类型：</td>
							<td>
								<select name="containerType">
									<option value="1">FCL</option>
									<option value="2">LCL</option>
								</select>
							</td>
							<td>订单月份：</td>
							<td>
								<input type="text" value="2011-12-11"/>
							</td>
						</tr>
						<tr>
							<td>客户名称：</td>
							<td>
								<select name="customer.id">
									<option value="1">深圳鑫远航</option>
									<option value="2">武汉锋火</option>
								</select>
							</td>
							<td>客户资料：</td>
							<td>
								<textarea rows="5" cols="50"></textarea>
							</td>
							<td></td>
							<td></td>
						</tr>
					</table>
				</div>
			</fieldset>
			
		</div>
	</div>
	<script type="text/javascript">
	//$(document).ready(function(){
		//		var options = "";
			//	$.each(company_type,function(index, context) {
				//	options += "<option value="+context.code+">"+context.name+"</option>";
			//	});
				//$("#type").html(options);
			//});
	$(document).ready(function(){
		$("#addForm").validate({
			rules: {
				"mblCode": {
	                                required: true,
	                                maxlength: 32
	                            }
			},
			messages: {
				"name": {
					required: "请输入MBL号",
	                maxlength: "名称最长不得超过32个字符"
				}
			},
			errorPlacement: function(error, element){
				$("#span_" + element.attr("id")).html(error).attr("class", "error").addClass('red').next().hide();
			},
			submitHandler: function(form) {
				$("#butsubmit_id").attr("disabled","true");
				setDisabled('input[type="submit"]', window.document)
				$(form).ajaxSubmit({
					 success: function(response){
		        		var data = eval("("+response+")");
		        		if(data.flag==0){
	            			$.alert('添加订单成功', function(){window.location.href = "add";});
	            		}else{
	                		$.alert('添加失败,请重新输入');
	                		$("#butsubmit_id").attr("disabled","false");
	            		}
		        		setabled('input[type="submit"]', window.document);
		            }
	            });
			},
			success: function(label){
				var labelparent = label.parent();
				label.parent().html(labelparent.next().html()).attr("class", "valid");
			},
			onkeyup:false
		});
			
	});
	</script>
</body>
</html>